<template >
	<view>
		<login v-if="isShowLoginPage && !isLogin" @isShowLoginPage="_islog" @userInfo="_isUser"></login>
		<myhomepage v-if="!isShowLoginPage|| isLogin" @isShowLoginPage="_islog" :userInfo = "user"></myhomepage>
	</view>
</template>

<script>
	import myhomepage from "../../template/myhomepage/myhomepage.vue"
	import login from "../../template/login/login.vue"
	export default {
		components: {
			myhomepage,
			login
			},
		data() {
			return {
				//是否展示登录页
				isShowLoginPage:true,
				isLogin:getApp().globalData.isLogin,
				user:null,
			};
		},
		methods:{
			_islog(e){
				console.log(e)
				this.isShowLoginPage = e;
			},
			_isUser(e){
				console.log(e);
				this.user = e;
			}
		}
		
	}
</script>

<style lang="scss">
	page{
		background-image: url(../../static/img/R-C.jpg);
		 background-repeat: round;
	}
</style>
